<?php

/**
 * 订单结算服务
 */
namespace App\Service\OrderService;
use App\Service\BaseService;
use App\Model\PssModel\OrderSettlement;
class OrderSettleMentService extends BaseService
{
    /**
     * 判断供应商订单对账单是否已经发起过结算审核通过了
     * @param string $order_id
     */
    public function queryUserIsOrderVerifySettleMentPass(string $order_id)
    {
        $alias_table = OrderSettlement::instance()->getTable();
        $info = OrderSettlement::instance()
        ->from($alias_table." as ost")
        ->join("order_settlement_statement_detail as ossd","ossd.order_settlement_id","=","ost.id")
        ->join("order_settlement_statement as oss","oss.id","=","ossd.statement_id")
        ->where('ost.id',$order_id)
        ->where('oss.statement_status',1)
        ->first();
        return $info ? true : false;
    }
}
